﻿using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Navigation;
using com.IronOne.BoardPACWinApp.Sync;

// The Basic Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234237

namespace com.IronOne.BoardPACWinApp.View.Page
{
    /// <summary>
    ///     A basic page that provides characteristics common to most applications.
    /// </summary>
    public sealed partial class ErrorPage
    {
        public ErrorPage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var msg = e.Parameter as string;
            ErrorMsgTextBlock.Text = String.IsNullOrEmpty(msg)
                ? "this application encounter a fetal error.\nplease contact the system administrator."
                : msg.ToLower();

            SyncManager.StopSync();
        }

        private void LayoutAwarePage_Unloaded(object sender, RoutedEventArgs e)
        {
        }
    }
}